package com.archie.zhufengfm.entity.discoverrecommend;

import com.archie.zhufengfm.entity.Parsable;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Archie on 2015/10/22.
 */
public class ColumnsItem implements Parsable {


    /**
     * id : 1
     * orderNum : 2
     * title : 听友圈子
     * subtitle : 给你获得一种超能力的机会，你选择什么超能力？
     * coverPath : http://fdfs.xmcdn.com/group9/M07/1C/8C/wKgDYlV3rd2zGc9PAAAgRAu1VLU052.png
     * contentType : xzone
     * url :
     * sharePic :
     * enableShare : false
     * contentUpdatedAt : 0
     */

    private long id;
    private int orderNum;
    private String title;
    private String subtitle;
    private String coverPath;
    private String contentType;
    private String url;
    private String sharePic;
    private boolean enableShare;
    private int contentUpdatedAt;

    @Override
    public void parseJSON(JSONObject json) throws JSONException {

        if (json != null) {

            id = json.getLong("id");
            title = json.getString("title");
            subtitle = json.getString("subtitle");
            coverPath = json.getString("coverPath");

            orderNum = json.optInt("orderNum");
            contentType = json.optString("contentType");
            url = json.optString("url");
            sharePic = json.optString("sharePic", "");
            enableShare = json.optBoolean("enableShare");
            contentUpdatedAt = json.optInt("contentUpdatedAt");

        }

    }

    public void setId(long id) {
        this.id = id;
    }

    public void setOrderNum(int orderNum) {
        this.orderNum = orderNum;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setSubtitle(String subtitle) {
        this.subtitle = subtitle;
    }

    public void setCoverPath(String coverPath) {
        this.coverPath = coverPath;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public void setSharePic(String sharePic) {
        this.sharePic = sharePic;
    }

    public void setEnableShare(boolean enableShare) {
        this.enableShare = enableShare;
    }

    public void setContentUpdatedAt(int contentUpdatedAt) {
        this.contentUpdatedAt = contentUpdatedAt;
    }

    public long getId() {
        return id;
    }

    public int getOrderNum() {
        return orderNum;
    }

    public String getTitle() {
        return title;
    }

    public String getSubtitle() {
        return subtitle;
    }

    public String getCoverPath() {
        return coverPath;
    }

    public String getContentType() {
        return contentType;
    }

    public String getUrl() {
        return url;
    }

    public String getSharePic() {
        return sharePic;
    }

    public boolean getEnableShare() {
        return enableShare;
    }

    public int getContentUpdatedAt() {
        return contentUpdatedAt;
    }

}
